{*
Template for news module
Style of Than hoc online
@author: Trungdt
@since: Aug 25, 2011
*}
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}/modules/newsmodule/css/news_elise.css">

<div class="newsmodule_thanhoc page-news-events">
	{include file="`$smarty.const.BASE`modules/common/views/_permission_icons.tpl"}
	{if $enable_rss == true}<a class="rsslink" href="{rsslink}">{$_TR.alt_rssfeed}</a>{/if}
{if $moduletitle != ""}<h1>{$moduletitle}</h1>{/if}
	<div id="content-area">
		<div class="view view-news-feeds view-id-news_feeds view-display-id-page_1 view-dom-id-1 view-news-feeds view-id-news_feeds view-display-id-page_1 view-dom-id-1">
			<div class="view-content">
				<div class="item-list">
					<ul>
					{foreach key="key" name="object" from=$news item=newsitem}
						<li class="views-row views-row-6 views-row-even views-row-last">  
							{permissions level=$smarty.const.UILEVEL_PERMISSIONS}
							<div class="itemactions">
								{if $permissions.administrate == true || $newsitem->permissions.administrate == true}
								<a href="{link action=userperms int=$newsitem->id _common=1}"><img src="{$smarty.const.ICON_RELATIVE}userperms.png" title="{$_TR.alt_userperm_one}" alt="{$_TR.alt_userperm_one}" {$smarty.const.XHTML_CLOSING}></a>&nbsp;
								<a href="{link action=groupperms int=$newsitem->id _common=1}"><img src="{$smarty.const.ICON_RELATIVE}groupperms.png" title="{$_TR.alt_groupperm_one}" alt="{$_TR.alt_groupperm_one}" {$smarty.const.XHTML_CLOSING}></a>
								{/if}
								{if $permissions.edit_item == true || $newsitem->permissions.edit_item == true}
								{if $newsitem->approved == 2} {* in ap *}
								<img src="{$smarty.const.ICON_RELATIVE}edit.disabled.png" title="{$_TR.alt_edit_disabled}" alt="{$_TR.alt_edit_disabled}" {$smarty.const.XHTML_CLOSING}>
								{else}
								<a href="{link action=edit id=$newsitem->id}"><img src="{$smarty.const.ICON_RELATIVE}edit.png" title="{$_TR.alt_edit}" alt="{$_TR.alt_edit}" {$smarty.const.XHTML_CLOSING}></a>
								{/if}
								{/if}
								{if $permissions.delete_item == true || $newsitem->permissions.delete_item == true}
								{if $newsitem->approved == 2} {* in ap *}
								<img src="{$smarty.const.ICON_RELATIVE}delete.disabled.png" title="{$_TR.alt_delete_disabled}" alt="{$_TR.alt_delete_disabled}" {$smarty.const.XHTML_CLOSING}>
								{else}
								<a onclick="return confirm('{$_TR.delete_confirm}');" href="{link action=delete id=$newsitem->id}"><img src="{$smarty.const.ICON_RELATIVE}delete.png" title="{$_TR.alt_delete}" alt="{$_TR.alt_delete}" {$smarty.const.XHTML_CLOSING}></a>
								{/if}
								{/if}
								{if $permissions.manage_approval == 1}
								<a class="managerevisions" href="{link module=workflow datatype=newsitem m=newsmodule s=$__loc->src action=revisions_view id=$newsitem->id}" title="{$_TR.alt_revisions}">
									<img src="{$smarty.const.ICON_RELATIVE}revisions.png" alt="{$_TR.revisions}" {$smarty.const.XHTML_CLOSING}>
								</a>
								{/if}
							</div>
							{/permissions}
							<div class="views-field-field-story-image-fid">
								<span class="field-content"><a href="{if $newsitem->isRss}{$newsitem->rss_link}{else}/news/{$newsitem->internal_name}{/if}" class="imagecache imagecache-front_news_thumb imagecache-linked imagecache-front_news_thumb_linked"><img src="{$smarty.const.BASE_URL}/phpThumb.php?src={$newsitem->image}&w=75&h=75" alt="{$newsitem->title}" title="{$newsitem->title}" class="imagecache imagecache-front_news_thumb" width="75" height="75"></a></span>
							</div>

							<div class="views-field-title" style="width: 400px;">
								<span class="field-content"><a href="{if $newsitem->isRss}{$newsitem->rss_link}{else}/news/{$newsitem->internal_name}{/if}" title="{$newsitem->title}" alt="{$newsitem->title}">{$newsitem->title}</a></span>
							</div>

							<div class="views-field-created">
								<span class="field-content">[{$newsitem->datetime}]</span>
							</div>

							<div class="views-field-body">
								<span class="field-content">
									{if $newsitem->summary != ""}
										{$newsitem->summary}
									{else}
										{$newsitem->body|summarize:"html":"para"}
									{/if}
								</span>
							</div>

							<div class="views-field-view-node">
								<span class="field-content"><a href="{if $newsitem->isRss}{$newsitem->rss_link}{else}/news/{$newsitem->internal_name}{/if}" title="{$newsitem->title}" alt="{$newsitem->title}">Đọc thêm</a></span>
							</div>
						</li>
					{/foreach}
					</ul>
			</div>    </div>
		</div> <!-- /.view -->
	</div>
</div>

{* Paging & Form control *}
{permissions level=$smarty.const.UILEVEL_NORMAL}
	{if $morenews == 1 || $permissions.add_item == true || ($in_approval > 0 && $canview_approval_link == 1) || $permissions.view_unpublished == 1}
	<div class="moduleactions">
		{*
		{if $morenews == 1}
		<a class="viewmorenews" href="{link action=view_all_news}">{$_TR.view_all}</a>{br}
		{/if}
		*}
		{permissions level=$smarty.const.UILEVEL_NORMAL}
		{if $permissions.add_item == true}
		<a class="addnews" href="{link action=edit}">{$_TR.create_news}</a>{br}
		{/if}
		{if $in_approval > 0 && $canview_approval_link == 1}
		<a class="approvenews" href="{link module=workflow datatype=newsitem m=newsmodule s=$__loc->src action=summary}">{$_TR.view_approval}</a>{br}
		{/if}
		{if $permissions.view_unpublished == 1 }
		<a class="expirednews" href="{link action=view_expired}">{$_TR.view_expired}</a>{br}
		{/if}
		{/permissions}
	</div>
	{/if}
{/permissions}
{paging current_page=$page pages=$pages action=view_page module=newsmodule page_length=4 src=$__loc->src}